package com.wimcorp.magic.abilities.trigger;

import javax.persistence.Entity;

import com.wimcorp.magic.abilities.Ability;
import com.wimcorp.magic.abilities.ComboAbility;
@Entity
public class ComboTrigger extends AbilityTrigger{

	public ComboTrigger(){}
	
	public ComboTrigger(Ability ability){
		super(ability);
	}
	
	public ComboTrigger(ComboTrigger abilityTrigger) {
		super(abilityTrigger);
	}

	@Override
	public void register() {
		ComboAbility comboAbility = (ComboAbility) getAbility();
		for(Ability ability : comboAbility.getAbilities()){
			ability.getTrigger().register();
		}
	}
	
	public void unRegister() {
		ComboAbility comboAbility = (ComboAbility) getAbility();
		for(Ability ability : comboAbility.getAbilities()){
			ability.getTrigger().unRegister();
		}
	}
	
	public ComboTrigger clone() {
		return new ComboTrigger(this);
	}
	
}
